/*
 * Copyright (c) 2019-2020, https://api.iot.10086.cn/(https://gitee.com/cmcc-iot-api/iot-card-open-application/).
 */
package cn.iot.card.open.sim.dto.general.enums;

/**
 * 银行枚举
 */
public enum BankEnum {

    ICBCB2C("ICBCB2C", "中国工商银行"),

    ICBCBTB("ICBCBTB", "中国工商银行-企业银行"),

    ICBC_DEBIT("ICBC-DEBIT", "中国工商银行-纯借记卡渠道"),

    ABC("ABC", "中国农业银行"),

    ABCBTB("ABCBTB", "中国农业银行-企业银行"),

    CCB("CCB", "中国建设银行"),

    CCBBTB("CCBBTB", "中国建设银行-企业银行"),

    CCB_DEBIT("CCB-DEBIT", "中国建设银行-纯借记卡渠道"),

    BOCB2C("BOCB2C", "中国银行"),

    BOCBTB("BOCBTB", "中国银行-企业银行"),

    BOC_DEBIT("BOC-DEBIT", "中国银行-纯借记卡渠道"),

    CMB("CMB", "招商银行"),

    CMBBTB("CMBBTB", "招商银行-企业银行"),

    CMB_DEBIT("CMB-DEBIT", "招商银行-纯借记卡渠道"),

    COMM_DEBIT("COMM-DEBIT", "交通银行-纯借记卡渠道"),

    SPABANK("SPABANK", "平安银行"),

    SPA_DEBIT("SPA-DEBIT", "平安银行-纯借记卡渠道"),

    SPDB("SPDB", "上海浦东发展银行"),

    SPDBB2B("SPDBB2B", "上海浦东发展银行-企业银行"),

    SPDBDEBIT("SPDB-DEBIT", "上海浦东发展银行-纯借记卡渠道"),

    GDB("GDB", "广发银行"),

    GDB_DEBIT("GDB-DEBIT", "广发银行-纯借记卡渠道"),

    POSTGC("POSTGC", "中国邮政储蓄银行"),

    PSBC_DEBIT("PSBC-DEBIT", "中国邮政储蓄银行-纯借记卡渠道"),

    CIB("CIB", "兴业银行"),

    FDB("FDB", "富滇银行"),

    HZCBB2C("HZCBB2C", "杭州银行"),

    SHBANK("SHBANK", "上海银行"),

    NBBANK("NBBANK", "宁波银行"),

    abc1003("abc1003", "visa"),

    abc1004("abc1004", "master"),

    CEB_DEBIT("CEB-DEBIT", "中国光大银行-纯借记卡渠道"),

    BJBANK("BJBANK", "北京银行-纯借记卡渠道"),

    SHRCB("SHRCB", "上海农商银行-纯借记卡渠道"),

    WZCBB2C_DEBIT("WZCBB2C-DEBIT", "温州银行-纯借记卡渠道"),

    COMM("COMM", "交通银行-纯借记卡渠道"),

    CMBC("CMBC", "中国民生银行-纯借记卡渠道"),

    BJRCB("BJRCB", "北京农村商业银行-纯借记卡渠道"),

    CITIC_DEBIT("CITIC-DEBIT", "中信银行-纯借记卡渠道"),

    NULL("NULL", "");

    BankEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }

    private String code;

    private String message;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    /**
     * 获取 by code.
     *
     * @param code
     * @return 返回 by code
     * @author cmcc-iot-api
     * @date 20200115 11:03:14
     */
    public static BankEnum getByCode(String code) {
        for (BankEnum each : BankEnum.class.getEnumConstants()) {
            //利用code进行循环比较，获取对应的枚举
            if (each.getCode().equals(code)) {
                return each;
            }
        }
        return NULL;
    }
}
